﻿using System;
using System.Collections.Generic;
using System.Linq;

using SharedGenomics.Core;
using SharedGenomics.Domain;
using SharedGenomics.Annotations;

namespace SharedGenomics.Workbench.Annotations.Requests
{
    public class TavernaAnnotationExtractor
    {
        public virtual IEnumerable<IAnnotation> GetAnnotations(TavernaAnnotationData data)
        {
            data.ThrowIfNull("data");

            List<IAnnotation> annotations = new List<IAnnotation>();

            Gene gene = data.Gene ?? new Gene { Name = "Gene not found" };
            annotations.Add(new GeneSummaryAnnotation(gene));

            annotations.Add(new KeggPathwayAnnotation(data.KeggPathways));
            annotations.Add(new PublicationsAnnotation(data.Publications));
            //TODO: find out if there's an annotation for kegg ids...

            return annotations;
        }
    }
}
